<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('员工编辑')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-post-add">
		<input type="hidden" name="id" th:value="${employee.id}">
		<div class="form-group">
			<label class="col-sm-3 control-label is-required">姓名：</label>
			<div class="col-sm-8">
				<input class="form-control" th:value="${employee.name}" type="name" name="name" id="postName" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label is-required">邮箱：</label>
			<div class="col-sm-8">
				<input class="form-control" th:value="${employee.email}" type="text" name="email" id="postCode" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label is-required">年龄：</label>
			<div class="col-sm-8">
				<input class="form-control" th:value="${employee.age}" type="text" name="age" id="postSort" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">性别：</label>
			<div class="col-sm-8">
				<div class="radio-box" th:each="dict : ${@dict.getType('sys_user_sex')}">
					<input type="radio" th:id="${dict.id}" name="status" th:value="${dict.value}" th:field="${employee.sex}">
					<label th:for="${dict.id}" th:text="${dict.label}"></label>
				</div>
			</div>
		</div>

<!--		<div class="form-group">-->
<!--			<label class="col-sm-3 control-label is-required">是否超管：</label>-->
<!--			<div class="col-sm-8">-->
<!--				<div class="radio-box" th:each="dict : ${@dict.getType('emp_admin')}">-->
<!--					<input type="radio" th:id="${dict.id}" name="admin" th:value="${dict.value}" th:checked="${dict.isDefault}">-->
<!--					<label th:for="${dict.id}" th:text="${dict.label}"></label>-->
<!--				</div>-->
<!--			</div>-->
<!--		</div>-->

<!--		<div class="form-group">-->
<!--			<label class="col-sm-3 control-label is-required">入职时间：</label>-->
<!--			<div class="col-sm-8">-->
<!--				<div class="input-group date">-->
<!--					<input class="form-control" type="text" name="hiredate"  placeholder="yyyy-MM-dd HH:mm" required>-->
<!--					<span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--				</div>-->
<!--			</div>-->
<!--		</div>-->

		<div class="form-group">
			<label class="col-sm-3 control-label">所在部门：</label>
			<div class="col-sm-8">
				<select name="dept.id" class="form-control m-b"  >
					<option th:each="u : ${departments}" th:field="${employee.dept.id}" th:text="${u.name}" th:value="${u.id}"></option>
				</select>
			</div>
		</div>

	</form>
</div>
<th:block th:include="common/include :: footer" />
<th:block th:include="common/include :: datetimepicker" />
<script type="text/javascript">
	var prefix = ctx + "/business/employee";

	function submitHandler() {
		if ($.validate.form()) {
			// 保存信息 刷新表格
			// 若依的save方法，参数1：提交的地址 参数2：提交带的数据 参数3：回调函数（这里没有传）
			$.operate.save(prefix + "/edit", $('#form-post-add').serialize());
		}
	}

	$("input[name='hiredate']").datetimepicker({
		format: "yyyy-mm-dd hh:ii",
		autoclose: true
	});
</script>
</body>
</html>
